package com.kotlin.novel.imageloader

import android.app.Activity
import android.widget.ImageView
import com.kotlin.novel.R
import com.bumptech.glide.Glide


class ImageLoader {
    companion object {
        fun loadImage(activity: Activity, imageView: ImageView, imgUrl: String?) {
            Glide.with(activity).load(imgUrl).placeholder(R.drawable.pic_placeholder).error(R.drawable.error_placeholder).into(imageView)
        }

        fun loadImage(fragmentActivity: androidx.fragment.app.FragmentActivity, imageView: ImageView, imgUrl: String?) {
            Glide.with(fragmentActivity).load(imgUrl).placeholder(R.drawable.pic_placeholder).error(R.drawable.error_placeholder).into(imageView)
        }
    }
}